from django.db import models
from django.contrib.auth.models import AbstractUser


# Create your models here.
from utils.mybase_model import Base


class Vip(Base):
    title = models.CharField(max_length=20)
    level = models.CharField(max_length=10,choices=((1,"普通会员"),(2,'超级会员')))
    desc = models.CharField(max_length=255)
    class Meta:
        db_table = 'tb_vip'

class User(AbstractUser):
    phone = models.CharField('手机号', max_length=11)
    img = models.ImageField(upload_to='user', null=True)
    nick_name = models.CharField('昵称', max_length=20)
    address = models.CharField('地址', max_length=255)
    vip = models.ForeignKey(Vip,on_delete = models.CASCADE,null=True)
    class Meta:
        db_table = 'tb_user'


